<div class="col-md-2">
  <%= render :partial => "search/nav", :locals => { :section => "search-questions" } %>
</div>

<div class="col-md-10">
  <div class="container">
  
    <h2>Search questions</h2>

    <%= render partial: "search/form", locals: { searchType: "questions/" } %>

    <% if params[:query].blank?%>
      <p>Please enter a search term.</p>
      
    <% elsif @questions.present? %>
      <h4>Results for "<b><%= params[:query] %></b>":</h4>

      <div class="related-tags-container">
        <%= render partial: 'tag/related', locals: { tags: Tag.related(params[:query]) } if params[:query] %>
      </div>

      <%= render partial: 'search/pinned', locals: { query: params[:query] } if params[:query] %>

      <%= render partial: "questions/questions", locals: { questions: @questions } %>

    <% else %>
      <p>No results found for "<b><%= params[:query] %></b>" :-(</p>
      <p>Try searching <a href="/search/content/<%= params[:query] %>">all content</a></p>
    <% end %>
  </div>
</div>
